<? 
	$title="User List"; 
	$pageid="4";
	$accessid=",a10,";

	if(isset($_POST['btnsubmit']))
	{
		require("required/dbconnect.php");
		
		$company_name=$_POST['company_name'];
		$contact_number=$_POST['contact_number'];
		$email=$_POST['email'];
		$email_hidden=$_POST['email_hidden'];
		$email_security=$_POST['email_security'];
		$address1=$_POST['address1'];
		$address2=$_POST['address2'];
		$address3=$_POST['address3'];
		$address4=$_POST['address4'];
		$fax=$_POST['fax'];
		$facebook_link=$_POST['facebook_link'];
		$twitter_link=$_POST['twitter_link'];
		$blog_link=$_POST['blog_link'];
		
		
		$update=mysql_query("update os_contactinfo set company_name='$company_name',contact_number='$contact_number',email='$email',email_hidden='$email_hidden',email_security='$email_security',
					address1='$address1',address2='$address2',address3='$address3',address4='$address4',facebook_link='$facebook_link',twitter_link='$twitter_link',blog_link='$blog_link',fax='$fax' where id=1")or die(mysql_error());
		
		
		header("Location:sys_contact.php?msg=1");
	}
	
	require("required/dbconnect.php"); 
	require("required/header.php");
	require("required/function.php");
	checkAccess("allow_content_management",1);
?>
<script src="required/js/jquery-1.4.2.js"></script>
<script src="required/js/common_javascript.js"></script>
<?
	if(empty($_GET['msg']))
	{
		$msg="";
	}
	else
	{
		$msg="<div class='dw_success'>Data updated!</div>";
		echo "<script>displayMsg('divMsg')</script>";	
	}
	
	
	$get_info=mysql_query("select * from os_contactinfo where id=1");
	
	$a=mysql_fetch_array($get_info,MYSQL_ASSOC);
	
	
?>
<table width="100%"  cellpadding="0" cellspacing="5" height="300">
<tr>
	
	<td valign="top">
			<div id="divMsg"><?= $msg ?></div>
			<form action="<?= $_SERVER['PHP_SELF'] ?>" method="post">
			<table width="100%">
			
				<tr>
					<td colspan="3" class="title">
				
					<strong>Contact Settings</strong>
					
					</td>
				</tr>
                <tr>
					<td>Company Name</td><td width="66%"><input type="text" value="<?= $a['company_name'] ?>" name="company_name" maxlength="200" size="50"></td>
				</tr>
				<tr>
					<td>Address</td><td width="66%"><input type="text" value="<?= $a['address1'] ?>" name="address1" maxlength="200" size="50"></td>
				</tr>
				<tr>
					<td></td><td width="66%"><input type="text" value="<?= $a['address2'] ?>" name="address2" maxlength="200" size="50"></td>
				</tr>
                <tr>
					<td></td><td width="66%"><input type="text" value="<?= $a['address3'] ?>" name="address3" maxlength="200" size="50"></td>
				</tr>
                 <tr>
					<td></td><td width="66%"><input type="text" value="<?= $a['address4'] ?>" name="address4" maxlength="200" size="50"></td>
				</tr>
				<tr>
					<td>Contact number</td><td width="66%"><input type="text" value="<?= $a['contact_number'] ?>" name="contact_number" maxlength="20" size="20"></td>
				</tr>
				<tr>
					<td>Fax</td><td width="66%"><input type="text" value="<?= $a['fax'] ?>" name="fax" maxlength="20" size="20"></td>
				</tr>
				<tr>
					<td>Email (publish)</td><td><input type="text" value="<?= $a['email'] ?>" name="email" maxlength="200" size="80"></td>
				</tr>
                <tr>
					<td>Email (receiving enquiries)</td><td><input type="text" value="<?= $a['email_hidden'] ?>" name="email_hidden" maxlength="200" size="80">
			
					</td>
				</tr>
               
				<tr>
					<td>Security Email 
                    <br />(to unlock brutal force login and etc) </td><td><input type="text" value="<?= $a['email_security'] ?>" name="email_security" maxlength="200" size="80">
					<br>
					separate all the emails with <strong>COMMA</strong> ","
					</td>
				</tr>
				 <tr>
					<td>Facebook link</td><td width="66%"><input type="text" value="<?= $a['facebook_link'] ?>" name="facebook_link" maxlength="200" size="80">
                    <br />
                    leave the field blank if facebook is not required
                    </td>
				</tr>
				 <tr>
					<td>Twitter link</td><td width="66%"><input type="text" value="<?= $a['twitter_link'] ?>" name="twitter_link" maxlength="200" size="80">
                                        <br />
                    leave the field blank if twitter is not required
                    </td>
				</tr>
                <tr>
					<td>Blog link</td><td width="66%"><input type="text" value="<?= $a['blog_link'] ?>" name="blog_link" maxlength="200" size="80">
                    <br />
                    leave the field blank if blog is not required
                    </td>
				</tr>
			
				<td width="34%">
					
					<input type="submit" value="Save" class="button" name="btnsubmit">
				</td>
			</table>
			</form>
		</td>
	</tr>
	
	
</table>
<? require("required/footer.php"); ?>

